
##### User configurable options #####

MPI_CC      = @MPI_CC@
MPI_CLINKER = $(MPI_CC)
#
MPI_CFLAGS  = @MPI_CFLAGS@
MPI_LIBS    = @MPI_LIBS@
CFLAGS      = @CFLAGS@
MPE_INCDIR  = @includebuild_dir@
MPE_LIBDIR  = @libbuild_dir@
PROF_LIBS   = -L$(MPE_LIBDIR) @PROF_LIBS@ @X_LIB@ $(MPI_LIBS) -lm
#
INCLUDE_DIR = -I$(MPE_INCDIR)
LDFLAGS     = @LDFLAGS@

### End User configurable options ###

RM          = rm

@VPATH@

srcdir         = @srcdir@

# MPE include path, x_INCS, goes in front of MPI include path, MPI_xFLAGS,
# in case MPI include path is in MPI_xFLAGS containing old MPE include path.
MPICC_FLAGS    = $(INCLUDE_DIR) $(MPI_CFLAGS) $(MPE_COPTS)
MPICC_LDFLAGS  = $(LDFLAGS) $(MPI_CFLAGS) $(MPE_LDOPTS)
EXECS          = gmm@EXEEXT@ mm@EXEEXT@ vb@EXEEXT@

.SUFFIXES: .c .@OBJEXT@ @EXEEXT@

.c.@OBJEXT@:
	$(MPI_CC) $(MPICC_FLAGS) -c $<

.@OBJEXT@@EXEEXT@:
	$(MPI_CLINKER) $(MPICC_LDFLAGS) -o $@ $< $(PROF_LIBS)

default: $(EXECS)

gmm.@OBJEXT@:	gmm.c
	$(MPI_CC) $(MPICC_FLAGS) -DUSE_GRAPHICS -c $?

mm.@OBJEXT@:	gmm.c
	$(MPI_CC) $(MPICC_FLAGS) -c -o mm.@OBJEXT@ $?

vb.@OBJEXT@:	vb.c
	$(MPI_CC) $(MPICC_FLAGS) -c $?

clean:
	@-$(RM) -f *.@OBJEXT@ *~ PI* $(EXECS) gmmlog

distclean: clean
	@-$(RM) -f Makefile
